
<template>
  <div>
    <div class="user">
      <van-nav-bar left-arrow @click-left="onClickLeft">
        <template #right>
          <van-icon name="font-o" size="18"/>
        </template>
      </van-nav-bar>
      <div class="tourist">
        <dl>
            <dt><img src="@/assets/images/user/youke.jpg"/></dt>
            <dd>
                <p class="username">游客</p>
                <p class="check">这个家伙很懒，什么都没留下</p>
            </dd>
        </dl>
      </div>
    </div>
    <van-tabs>
        <div v-for="(item,index) in info_list" :key="index">
          <van-tab class="tabContent" :title="item.title">
            <div class="list" v-for="(v,i) in item.details" :key="i">
              <div class="listLeft">
                <img :src="v.imgUrl"/>
                <p class="word">{{ v.word }}</p>
              </div>
              <div class="listRight">
                <p class="glt">></p>
              </div>
            </div>
            <van-empty v-if="item.details === null" description="暂无动态" />
          </van-tab>
        </div>
      </van-tabs>

  </div>
</template>

<script>
export default {
  name: 'personalInfo',
  data(){
    return{
      info_list:[
        {id:1,path:'/index',title:'消息',details:[{id:11,path:'/index',word:'我收到的回复',imgUrl:require('@/assets/images/user/huifu.jpg')}, {id:12,path:'/index',word:'我收到的赞',imgUrl:require('@/assets/images/user/dianzan.jpg')}]},
        {id:2,path:'/index',title:'动态',details:null},
        {id:3,path:'/index',title:'评论',details:null},
        {id:4,path:'/index',title:'点赞',details:null},
        {id:5,path:'/index',title:'看过的人',details:null},
      ],
      problem:''
    }
  },
  created(){

  },
  methods:{
    onClickLeft(){
      this.$router.go(-1)
    }
  }
} 
</script>

<style scoped>
.user{
    width: 360px;
    margin: 0 auto;
    background-color: #fff;
    padding: 10px;
    margin: 10px;
    border-radius: 10px;
}
.tourist dl{
    display: flex;
    text-align: left;
}
.tourist dl img{
  width: 60px;
  height: 60px;
  border-radius: 50px;
  border: 2px solid white;
}
.tourist dd{
  margin-left: 10px;
}
.username{
  font-size: 20px;
  margin: 10px 0 8px 10px;
}
.check{
  font-size: 12px;
  color: #a7adb3;
  margin: 0 0 8px 10px;
}
.list{
  width: 310px;
  height: 70px;
  padding: 0 10px;
  line-height: 70px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1PX solid #f0f0f0;
}
.list img{
  width: 50px;
  height: 50px;
  border-radius: 50px;
  margin: 10px 10px 0 0;
}
.list .word{
  color: black;
  font-size: 14px;
  margin: 0;
}
.listLeft,.listRight{
  display: flex;
}
.glt{
  color: #a2a2a2;
  margin: 0 0 0 10px;
}
.tabContent{
  padding: 0 20px!important;
}
</style>
